<div class="middle">
  <div class="middle-header">
    <div class="container-fluid">
      <div class="page-header page-header-bleed-right page-header-bleed-left">
        <div class="pull-right" ng-if="project && (secretsVersion | canI : 'create') && secrets.length">
          <a ng-href="project/{{project.metadata.name}}/create-secret" class="btn btn-default">Create Secret</a>
        </div>
        <h1>
          Secrets
          <span class="page-header-link">
            <a ng-href="{{'secrets' | helpLink}}" target="_blank">
              Learn More <i class="fa fa-external-link" aria-hidden="true"></i>
            </a>
          </span>
        </h1>
      </div>
      <div ng-if="unfilteredSecrets" class="data-toolbar">
        <div class="data-toolbar-filter">
          <project-filter></project-filter>
        </div>
      </div>
    </div>
  </div><!-- /middle-header-->
  <div class="middle-content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div ng-if="(secrets | size) === 0">
            <p ng-if="!secretsLoaded">
              Loading...
            </p>
            <div ng-if="secretsLoaded" class="empty-state-message text-center">
              <div ng-if="!filterWithZeroResults">
                <h2>No secrets.</h2>
                <p>No secrets have been added to project {{projectName}}.</p>
                <p ng-if="project && (secretsVersion | canI : 'create')">
                  <a ng-href="project/{{project.metadata.name}}/create-secret" class="btn btn-primary btn-lg">Create Secret</a>
                </p>
              </div>
              <div ng-if="filterWithZeroResults">
                <h2>The filter is hiding all secrets. <button type="button" class="btn btn-link inline-btn-link" ng-click="clearFilter()">Clear All Filters</button></h2>
              </div>
            </div>
          </div>
          <table ng-if="(secrets | size) > 0" class="table table-bordered table-mobile secrets-table table-layout-fixed">
            <colgroup>
              <col class="col-sm-5">
              <col class="col-sm-5">
              <col class="col-sm-2">
            </colgroup>
            <thead>
              <tr>
                <th>Name</th>
                <th>Type</th>
                <th>Created</th>
              </tr>
            </thead>
            <tbody>
              <tr ng-repeat="secret in secrets track by (secret | uid)">
                <td data-title="Name">
                  <a ng-href="{{secret | navigateResourceURL}}">{{secret.metadata.name}}</a>
                </td>
                <td data-title="Type">
                  {{secret.type}}
                </td>
                <td data-title="Created">
                  <span am-time-ago="secret.metadata.creationTimestamp"></span>
                </td>
              </tr>
            </tbody>
          </table>
        </div><!-- /col-* -->
      </div>
    </div>
  </div><!-- /middle-content -->
</div>
